package com.pbc.gmp.action;

import com.pbc.gmp.model.basemodel.Position;
import com.pbc.gmp.service.IPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *   前端控制器
 * </p>
 *
 * @author kjk
 * @since 2017-04-17
 */
@Controller
@RequestMapping("/position")
public class PositionController {
    @Autowired private IPositionService positionService;
    @RequestMapping(value = "/getposlist", method = {RequestMethod.POST })
    @ResponseBody
    public List<Position> getPosList(@RequestParam Long id){
        List<Position> positions=positionService.selectPositionsByOrgId(id);
        if(positions==null)
        {
            return null;
        }else {
            return positions;
        }


    }
	
}
